#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QStandardItem>
#include <QStandardItemModel>
#include <QTreeView>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    treeView=new QTreeView(this);
    model=new QStandardItemModel(4,1);
    QStandardItem *item1=new QStandardItem("first");
    QStandardItem *item2=new QStandardItem("second");
    QStandardItem *item3=new QStandardItem("third");
    QStandardItem *item4=new QStandardItem("fourth");
    QStandardItem *item5=new QStandardItem("fifth");
    QStandardItem *item6=new QStandardItem("sixth");
    model->setItem(0,0,item1);
    model->setItem(1,0,item2);
    model->setItem(2,0,item3);
    model->setItem(3,0,item4);
    item4->appendRow(item5);
    item5->appendRow(item6);
    treeView->setModel(model);
    this->setCentralWidget(treeView);
}

MainWindow::~MainWindow()
{
    delete ui;
}
